{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Collapsible headings\n",
    "放下/收起notebook的某些内容\n",
    "Notify\n",
    "Notify功能就能在任务处理完后及时向你发送通知\n",
    "Codefolding\n",
    "折叠代码\n",
    "tqdm_notebook\n",
    "显示进度条\n",
    "%debug\n",
    "调试代码，直接跳到错误的地方\n",
    "Table of Contents\n",
    "自动生成目录\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 安装扩展"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: http://pypi.douban.com/simple\n",
      "Requirement already satisfied: jupyter_contrib_nbextensions in c:\\program files\\python36\\lib\\site-packages (0.5.0)\n",
      "Requirement already satisfied: jupyter-contrib-core>=0.3.3 in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (0.3.3)\n",
      "Requirement already satisfied: jupyter-latex-envs>=1.3.8 in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (1.4.4)\n",
      "Requirement already satisfied: lxml in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (4.2.5)\n",
      "Requirement already satisfied: nbconvert>=4.2 in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (5.3.1)\n",
      "Requirement already satisfied: jupyter-highlight-selected-word>=0.1.1 in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (0.2.0)\n",
      "Requirement already satisfied: jupyter-core in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (4.4.0)\n",
      "Requirement already satisfied: tornado in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (5.1)\n",
      "Requirement already satisfied: traitlets>=4.1 in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (4.3.2)\n",
      "Requirement already satisfied: pyyaml in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (3.13)\n",
      "Requirement already satisfied: ipython-genutils in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (0.2.0)\n",
      "Requirement already satisfied: jupyter-nbextensions-configurator>=0.4.0 in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (0.4.0)\n",
      "Requirement already satisfied: notebook>=4.0 in c:\\program files\\python36\\lib\\site-packages (from jupyter_contrib_nbextensions) (5.6.0)\n",
      "Requirement already satisfied: setuptools in c:\\program files\\python36\\lib\\site-packages (from jupyter-contrib-core>=0.3.3->jupyter_contrib_nbextensions) (39.1.0)\n",
      "Requirement already satisfied: ipython in c:\\program files\\python36\\lib\\site-packages (from jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (6.4.0)\n",
      "Requirement already satisfied: entrypoints>=0.2.2 in c:\\program files\\python36\\lib\\site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (0.2.3)\n",
      "Requirement already satisfied: jinja2 in c:\\program files\\python36\\lib\\site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (2.10)\n",
      "Requirement already satisfied: nbformat>=4.4 in c:\\program files\\python36\\lib\\site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (4.4.0)\n",
      "Requirement already satisfied: bleach in c:\\program files\\python36\\lib\\site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (1.5.0)\n",
      "Requirement already satisfied: testpath in c:\\program files\\python36\\lib\\site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (0.3.1)\n",
      "Requirement already satisfied: mistune>=0.7.4 in c:\\program files\\python36\\lib\\site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (0.8.3)\n",
      "Requirement already satisfied: pygments in c:\\program files\\python36\\lib\\site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (2.2.0)\n",
      "Requirement already satisfied: pandocfilters>=1.4.1 in c:\\program files\\python36\\lib\\site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (1.4.2)\n",
      "Requirement already satisfied: decorator in c:\\program files\\python36\\lib\\site-packages (from traitlets>=4.1->jupyter_contrib_nbextensions) (4.3.0)\n",
      "Requirement already satisfied: six in c:\\program files\\python36\\lib\\site-packages (from traitlets>=4.1->jupyter_contrib_nbextensions) (1.11.0)\n",
      "Requirement already satisfied: prometheus-client in c:\\program files\\python36\\lib\\site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (0.3.0)\n",
      "Requirement already satisfied: ipykernel in c:\\program files\\python36\\lib\\site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (4.8.2)\n",
      "Requirement already satisfied: pyzmq>=17 in c:\\program files\\python36\\lib\\site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (17.1.0)\n",
      "Requirement already satisfied: jupyter-client>=5.2.0 in c:\\program files\\python36\\lib\\site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (5.2.3)\n",
      "Requirement already satisfied: Send2Trash in c:\\program files\\python36\\lib\\site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (1.5.0)\n",
      "Requirement already satisfied: terminado>=0.8.1 in c:\\program files\\python36\\lib\\site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (0.8.1)\n",
      "Requirement already satisfied: backcall in c:\\program files\\python36\\lib\\site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.1.0)\n",
      "Requirement already satisfied: simplegeneric>0.8 in c:\\program files\\python36\\lib\\site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.8.1)\n",
      "Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.15 in c:\\program files\\python36\\lib\\site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (1.0.15)\n",
      "Requirement already satisfied: jedi>=0.10 in c:\\program files\\python36\\lib\\site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.12.1)\n",
      "Requirement already satisfied: colorama; sys_platform == \"win32\" in c:\\program files\\python36\\lib\\site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.3.9)\n",
      "Requirement already satisfied: pickleshare in c:\\program files\\python36\\lib\\site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.7.4)\n",
      "Requirement already satisfied: MarkupSafe>=0.23 in c:\\program files\\python36\\lib\\site-packages (from jinja2->nbconvert>=4.2->jupyter_contrib_nbextensions) (1.0)\n",
      "Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in c:\\program files\\python36\\lib\\site-packages (from nbformat>=4.4->nbconvert>=4.2->jupyter_contrib_nbextensions) (2.6.0)\n",
      "Requirement already satisfied: html5lib!=0.9999,!=0.99999,<0.99999999,>=0.999 in c:\\program files\\python36\\lib\\site-packages (from bleach->nbconvert>=4.2->jupyter_contrib_nbextensions) (0.9999999)\n",
      "Requirement already satisfied: python-dateutil>=2.1 in c:\\program files\\python36\\lib\\site-packages (from jupyter-client>=5.2.0->notebook>=4.0->jupyter_contrib_nbextensions) (2.7.3)\n",
      "Requirement already satisfied: pywinpty>=0.5; os_name == \"nt\" in c:\\program files\\python36\\lib\\site-packages (from terminado>=0.8.1->notebook>=4.0->jupyter_contrib_nbextensions) (0.5.4)\n",
      "Requirement already satisfied: wcwidth in c:\\program files\\python36\\lib\\site-packages (from prompt-toolkit<2.0.0,>=1.0.15->ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.1.7)\n",
      "Requirement already satisfied: parso>=0.3.0 in c:\\program files\\python36\\lib\\site-packages (from jedi>=0.10->ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.3.1)\n"
     ]
    }
   ],
   "source": [
    "!python -m pip install jupyter_contrib_nbextensions\n",
    "!jupyter contrib nbextension install --user --skip-running-check  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master\n",
    "!pip install jupyter_nbextensions_configurator\n",
    "!jupyter contrib nbextension install –user\n",
    "!jupyter nbextensions_configurator enable –user \n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 运行 py 文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "Missing parentheses in call to 'print' (echo.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"C:\\Users\\user\\Desktop\\shell\\echo.py\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m    print \"python 2.7\"\u001b[0m\n\u001b[1;37m                     ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m Missing parentheses in call to 'print'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "python 2.7\n"
     ]
    }
   ],
   "source": [
    "%run  \"C:\\Users\\user\\Desktop\\shell\\echo.py\"   # 不同内核无法通用啊\n",
    "! python2 \"C:\\Users\\user\\Desktop\\shell\\echo.py\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
